home *** CD-ROM | disk | FTP | other *** search
/ AMIGA-CD 2 / Amiga-CD - Volume 2.iso / gepackte_disketten / 1994 / 08_94_5.dms / 08_94_5.adf / term-4.0-Source.lha / termData.c < prev    next >
C/C++ Source or Header  |  1994-07-01  |  27KB  |  1,056 lines

  1. /*
  2. **    termData.c
  3. **
  4. **    Global data structures.
  5. **
  6. **    Copyright © 1990-1994 by Olaf `Olsen' Barthel
  7. **        All Rights Reserved
  8. */
  9.  
  10. #include "termGlobal.h"
  11.  
  12. BOOLEAN             DebugFlag;
  13.  
  14.     /* Libraries. */
  15.  
  16. struct ExecBase        *SysBase;
  17. struct DosLibrary    *DOSBase;
  18. struct Library        *GTLayoutBase;
  19.  
  20. struct IntuitionBase    *IntuitionBase;
  21. struct GfxBase        *GfxBase;
  22. struct RxsLib        *RexxSysBase;
  23. struct LocaleBase    *LocaleBase;
  24. struct Library        *GadToolsBase,
  25.             *TimerBase,
  26.             *ConsoleDevice,
  27.             *DiskfontBase,
  28.             *UtilityBase,
  29.             *AslBase,
  30.             *IFFParseBase,
  31.             *CxBase,
  32.             *IconBase,
  33.             *LayersBase,
  34.             *TranslatorBase,
  35.             *WorkbenchBase,
  36.             *AmigaGuideBase,
  37.             *XEmulatorBase,
  38.             *XProtocolBase,
  39.             *DataTypesBase,
  40.             *OwnDevUnitBase;
  41.  
  42. BYTE             Kick30;
  43.  
  44.     /* Timer device. */
  45.  
  46. struct timerequest    *TimeRequest;
  47. struct MsgPort        *TimePort;
  48.  
  49.     /* Console device. */
  50.  
  51. struct IOStdReq        *ConsoleRequest;
  52. struct KeyMap        *KeyMap;
  53. BPTR             KeySegment;
  54.  
  55.     /* Screen & Windows. */
  56.  
  57. struct Screen        *Screen,
  58.             *DefaultPubScreen,
  59.             *SharedScreen;
  60. struct Window        *Window;
  61. LONG             WindowWidth,
  62.              WindowHeight,
  63.              WindowLeft,
  64.              WindowTop;
  65. struct Window        *StatusWindow;
  66. struct Gadget        *StatusGadget;
  67. UWORD             StatusOffset;
  68. APTR             OldWindowPtr;
  69. struct BitMap        *InterleavedBitMap;
  70. UBYTE __far         ScreenTitle[80];
  71. UBYTE             DepthMask;
  72. LONG             RenderPens[4],
  73.              MappedPens[2][32],
  74.              SafeTextPen;
  75. struct DrawInfo        *DrawInfo;
  76. LONG             ScreenWidth,
  77.              ScreenHeight;
  78. BYTE             UseMasking;
  79. struct IBox         WindowBox = { -1,-1,-1,-1 };
  80.  
  81. struct BlockMarker    *WindowMarker;
  82. ULONG             ClickSecs,ClickMicros;
  83. BYTE             FirstClick = TRUE,HoldClick = FALSE;
  84. LONG             ClickX,ClickY;
  85.  
  86.     /* Workbench AppWindow support. */
  87.  
  88. struct AppWindow    *WorkbenchWindow;
  89. struct MsgPort        *WorkbenchPort;
  90.  
  91.     /* Graphics rendering. */
  92.  
  93. struct ViewPort        *VPort;
  94. struct RastPort        *RPort;
  95. struct Region        *ClipRegion,
  96.             *OldRegion;
  97. struct TextFont        *GFX,
  98.             *CurrentFont,
  99.             *UserTextFont;
  100. WORD             UserFontHeight,
  101.              UserFontWidth,
  102.              UserFontBase;
  103. UBYTE __far         UserFontName[40];
  104. struct TextFont        *TextFont;
  105. WORD             TextFontHeight,
  106.              TextFontWidth,
  107.              TextFontBase;
  108. struct TTextAttr     TextAttr;
  109. UBYTE __far         TextFontName[40];
  110. struct TTextAttr     UserFont;
  111. struct TagItem         TagDPI[2];
  112. APTR             VisualInfo;
  113. UWORD             FontRightExtend;
  114.  
  115. ULONG            (*  ReadAPen)(struct RastPort *RPort);
  116. ULONG            (*  ReadBPen)(struct RastPort *RPort);
  117. ULONG            (*  ReadDrMd)(struct RastPort *RPort);
  118. ULONG            (*  SetWrMsk)(struct RastPort *RPort,ULONG Mask);
  119.  
  120. UWORD MonoPens[] =
  121. {
  122.     0,1,1,1,1,1,0,0,1,    0,1,1,(UWORD)~0
  123. };
  124.  
  125. UWORD StandardPens[] =
  126. {
  127.     0,1,1,2,1,3,1,0,2,    1,2,1,(UWORD)~0
  128. };
  129.  
  130. UWORD ANSIPens[] =
  131. {
  132.     0,4,7,7,4,6,7,0,6,    0,7,0,(UWORD)~0
  133. };
  134.  
  135. UWORD EGAPens[] =
  136. {
  137.     0,15,15,15,8,7,15,0,7,    0,15,0,(UWORD)~0
  138. };
  139.  
  140. UWORD AtomicColours[16] =
  141. {
  142.     0x000,
  143.     0xDDD,
  144.     0x000,
  145.     0x000,
  146.     0x000,
  147.     0x000,
  148.     0x000,
  149.     0x000,
  150.     0x000,
  151.     0x000,
  152.     0x000,
  153.     0x000,
  154.     0x000,
  155.     0x000,
  156.     0x000,
  157.     0x000
  158. };
  159.  
  160. UWORD EGAColours[16] =
  161. {
  162.     0x000,    /* Black. */
  163.     0xA00,    /* Dark red. */
  164.     0x0A0,    /* Dark green. */
  165.     0xA60,    /* Dark yellow (orange). */
  166.     0x00A,    /* Dark blue. */
  167.     0xA0A,    /* Dark magenta.*/
  168.     0x0AA,    /* Dark cyan. */
  169.     0xBBB,    /* Light grey. */
  170.     0x666,    /* Dark grey. */
  171.     0xF00,    /* Red. */
  172.     0x0F0,    /* Green. */
  173.     0xFF0,    /* Yellow. */
  174.     0x00F,    /* Blue. */
  175.     0xF0F,    /* Magenta. */
  176.     0x0FF,    /* Cyan. */
  177.     0xFFF    /* White. */
  178. };
  179.  
  180. UWORD ANSIColours[16] =
  181. {
  182.     0x000,    /* Black. */
  183.     0xF00,    /* Red. */
  184.     0x0F0,    /* Green. */
  185.     0xFF0,    /* Yellow. */
  186.     0x00F,    /* Blue. */
  187.     0xF0F,    /* Magenta. */
  188.     0x0FF,    /* Cyan. */
  189.     0xFFF,    /* White. */
  190.  
  191.     0x000,    /* Black. */
  192.     0xF00,    /* Red. */
  193.     0x0F0,    /* Green. */
  194.     0xFF0,    /* Yellow. */
  195.     0x00F,    /* Blue. */
  196.     0xF0F,    /* Magenta. */
  197.     0x0FF,    /* Cyan. */
  198.     0xFFF    /* White. */
  199. };
  200.  
  201. UWORD             DefaultColours[32],
  202.              BlinkColours[32],
  203.              NormalColours[32],
  204.              StandardColours[32],
  205.              PaletteSize = 16;
  206.  
  207.     /* Line/Column offset tables. */
  208.  
  209. LONG            *OffsetXTable,
  210.             *OffsetYTable;
  211.  
  212.     /* DOS data. */
  213.  
  214. struct Process        *ThisProcess;
  215. struct Process        *StatusProcess;
  216. struct Task        *BufferTask;
  217. struct Process        *RexxProcess;
  218. struct MsgPort        *TermRexxPort;
  219. struct WBStartup    *WBenchMsg;
  220. BPTR             WBenchLock;
  221. struct TermPort        *TermPort;
  222. BYTE             CheckBit    = -1,
  223.              OwnDevBit    = -1;
  224. BYTE             InRexx;
  225. WORD             LimitCount    = -1;
  226. UBYTE __far         LimitMacro[MAX_FILENAME_LENGTH];
  227. LONG             CantQuit;
  228.  
  229.     /* Character conversion. */
  230.  
  231. struct InputEvent    *FakeInputEvent;
  232.  
  233.     /* Serial I/O. */
  234.  
  235. struct IOExtSer        *ReadRequest;
  236. struct IOExtSer        *WriteRequest;
  237. struct MsgPort        *ReadPort;
  238. APTR             ReadBuffer,
  239.              HostReadBuffer;
  240. UBYTE            *SerialMessage;
  241. ULONG             DTERate;
  242. BYTE             ProcessIO = TRUE;
  243.  
  244. UBYTE __far         NewDevice[MAX_FILENAME_LENGTH];
  245. LONG             NewUnit;
  246. BYTE             UseNewDevice,
  247.              UseNewUnit;
  248.  
  249. LONG BaudRates[] =
  250. {
  251.     110,300,600,1200,2400,4800,7200,9600,12000,14400,19200,31250,38400,57600,64000,76800,115200
  252. };
  253.  
  254. LONG             NumBaudRates = sizeof(BaudRates) / sizeof(LONG);
  255.  
  256. struct RendezvousSemaphore    RendezvousSemaphore;
  257.  
  258.     /* Localization support. */
  259.  
  260. struct Catalog        *Catalog;
  261. struct Locale        *Locale;
  262.  
  263.     /* Hotkeys. */
  264.  
  265. struct Hotkeys         Hotkeys;
  266.  
  267. struct NewBroker NewTermBroker =
  268. {
  269.     NB_VERSION,
  270.     "term",
  271.     "term © 1990-1994 by Olaf Barthel",
  272.     "Terminal program",
  273.     0,0,0,NULL,0
  274. };
  275.  
  276.     /* Static default fonts. */
  277.  
  278. struct TextAttr DefaultFont =
  279. {
  280.     (UBYTE *)"topaz.font",
  281.     8,
  282.     FS_NORMAL,
  283.     FPF_ROMFONT | FPF_DESIGNED
  284. };
  285.  
  286. struct TextAttr GFXFont =
  287. {
  288.     (UBYTE *)"GFX.font",
  289.     8,
  290.     FS_NORMAL,
  291.     FPF_DISKFONT
  292. };
  293.  
  294.     /* Character lookup tables. */
  295.  
  296. BYTE IsPrintable[256] =
  297. {
  298.     0,0,0,0,0,1,0,1,1,1,1,1,1,1,1,1,
  299.     0,1,0,1,0,0,0,0,0,0,0,1,0,0,0,0,
  300.     1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
  301.     1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
  302.     1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
  303.     1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
  304.     1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
  305.     1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,
  306.     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  307.     0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,
  308.     1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
  309.     1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
  310.     1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
  311.     1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
  312.     1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
  313.     1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
  314. };
  315.  
  316. BYTE CharType[256] =
  317. {
  318.     0,0,0,0,0,0,0,0,0,0,6,0,0,7,0,0,
  319.     0,5,0,4,0,0,0,0,0,0,0,0,0,0,0,0,
  320.     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  321.     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  322.     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  323.     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  324.     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  325.     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  326.     2,2,2,2,2,2,2,2,2,2,0,0,0,0,0,0,
  327.     0,0,0,0,0,3,1,1,1,1,0,0,0,0,0,0,
  328.     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  329.     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  330.     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  331.     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  332.     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  333.     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  334. };
  335.  
  336.     /* IBM <-> ISO font conversion. */
  337.  
  338. UBYTE __far IBMConversion[256] =
  339. {
  340.     0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x00,0x00,
  341.     0x00,0x11,0x00,0x13,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1B,0x00,0x00,0x00,0x00,
  342.     0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
  343.     0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
  344.     0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,
  345.     0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F,
  346.     0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F,
  347.     0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F,
  348.     0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  349.     0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  350.     0x00,0xAD,0x9B,0x9C,0x00,0x9D,0x00,0x15,0x00,0x00,0xA6,0x00,0x00,0x00,0xAE,0x00,
  351.     0xF8,0xF1,0xFD,0x00,0x00,0xE6,0x14,0xF9,0x00,0x00,0xA7,0xAF,0xAC,0xAB,0x00,0xA8,
  352.     0x00,0x00,0x00,0x00,0x8E,0x8F,0x92,0x80,0x00,0x90,0x00,0x00,0x00,0x00,0x00,0x00,
  353.     0x00,0xA5,0x00,0x00,0x00,0x00,0x99,0x00,0x00,0x00,0x00,0x00,0x9A,0x00,0x00,0xE1,
  354.     0x85,0xA0,0x83,0x00,0x84,0x86,0x91,0x87,0x8A,0x82,0x88,0x89,0x8D,0xA1,0x8C,0x00,
  355.     0x00,0xA4,0x95,0xA2,0x93,0x00,0x94,0x00,0x00,0x97,0xA3,0x96,0x81,0x00,0x00,0x98
  356. };
  357.  
  358.     /* Table of graphics characters. */
  359.  
  360. BYTE GfxTable[256] =
  361. {
  362.     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  363.     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  364.     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  365.     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  366.     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  367.     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  368.     1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
  369.     1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
  370.     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  371.     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  372.     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  373.     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  374.     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  375.     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  376.     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  377.     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  378. };
  379.  
  380.     /* Special character treatment. */
  381.  
  382. struct SpecialKey SpecialKeys[13] =
  383. {
  384.     BEL,    DoBeep,        /* Ring the bell. */
  385.     XON,    DoxON,        /* Flow control - stop output. */
  386.     BKS,    DoBackspace,    /* Erase a character. */
  387.     ENT,    DoLF_FF_VT,    /* Enter key. */
  388.     FFD,    DoFF,        /* Form feed. */
  389.     VTB,    DoLF_FF_VT,    /* Vertical tab (huh?). */
  390.     RET,    DoCR,        /* Return key. */
  391.     TAB,    DoTab,        /* Move to next tab stop. */
  392.     SI,    DoShiftIn,    /* Change to graphics mode */
  393.     SO,    DoShiftOut,    /* Change out of graphics mode. */
  394.     ENQ,    DoEnq,        /* Transmit answerback message. */
  395.     ESC,    DoEsc,        /* Start new control sequence. */
  396.     CSI,    DoCsi        /* Start new control sequence. */
  397. };
  398.  
  399. JUMP *SpecialTable;
  400.  
  401. BYTE AbortMap[256] =
  402. {
  403.     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  404.     0,0,0,0,0,0,0,0,1,0,1,2,0,0,0,0,
  405.     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  406.     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  407.     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  408.     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  409.     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  410.     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  411.     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  412.     0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,
  413.     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  414.     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  415.     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  416.     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  417.     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  418.     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  419. };
  420.  
  421. JUMP *AbortTable;
  422.  
  423. VOID (*  ConDump)(STRPTR,LONG);
  424. VOID (*  ConOutput)(STRPTR,LONG);
  425. VOID (*  ConProcessData)(register STRPTR,register LONG);
  426.  
  427.     /* Shared global string formatting buffer. */
  428.  
  429. UBYTE __far SharedBuffer[512];
  430.  
  431.     /* Some more handy buffers. */
  432.  
  433. UBYTE __far ARexxCommandBuffer[256],AmigaDOSCommandBuffer[256];
  434.  
  435.     /* Screen pull-down-menu. */
  436.  
  437. struct NewMenu TermMenu[] =
  438. {
  439.     { NM_TITLE, NULL,         0 , 0,        0, (APTR)0},
  440.     {  NM_ITEM, NULL,         0 , 0,        0, (APTR)0},
  441.     {   NM_SUB, NULL,         0 , 0,        0, (APTR)MEN_SAVE_AS_PICTURE},
  442.     {   NM_SUB, NULL,         0 , 0,        0, (APTR)MEN_SAVE_AS_TEXT},
  443.     {  NM_ITEM, NM_BARLABEL,     0 , 0,        0, (APTR)0},
  444.     {  NM_ITEM, NULL,         0 , 0,        0, (APTR)0},
  445.     {   NM_SUB, NULL,         0 , 0,        0, (APTR)MEN_PRINT_SCREEN},
  446.     {   NM_SUB, NULL,         0 , 0,        0, (APTR)MEN_PRINT_CLIP},
  447.     {  NM_ITEM, NM_BARLABEL,     0 , 0,        0, (APTR)0},
  448.     {  NM_ITEM, NULL,         0 , 0,        0, (APTR)0},
  449.     {   NM_SUB, NULL,         0 , TICK,    0, (APTR)MEN_CAPTURE_TO_FILE},
  450.     {   NM_SUB, NULL,         0 , TICK,    0, (APTR)MEN_CAPTURE_TO_PRINTER},
  451.     {  NM_ITEM, NM_BARLABEL,     0 , 0,        0, (APTR)0},
  452.     {  NM_ITEM, NULL,         0 , 0,        0, (APTR)MEN_ICONIFY},
  453.     {  NM_ITEM, NM_BARLABEL,     0 , 0,        0, (APTR)0},
  454.     {  NM_ITEM, NULL,         0 , 0,        0, (APTR)MEN_ABOUT},
  455.     {  NM_ITEM, NM_BARLABEL,     0 , 0,        0, (APTR)0},
  456.     {  NM_ITEM, NULL,         0 , 0,        0, (APTR)MEN_QUIT},
  457.  
  458.     { NM_TITLE, NULL,         0 , 0,        0, (APTR)0},
  459.     {  NM_ITEM, NULL,         0 , 0,        0, (APTR)MEN_COPY},
  460.     {  NM_ITEM, NULL,         0 , 0,        0, (APTR)MEN_PASTE},
  461.     {  NM_ITEM, NULL,         0 , 0,        0, (APTR)MEN_CLEAR},
  462.  
  463.     { NM_TITLE, NULL,         0 , 0,        0, (APTR)0},
  464.     {  NM_ITEM, NULL,         0 , 0,        0, (APTR)MEN_EXECUTE_DOS_COMMAND},
  465.     {  NM_ITEM, NULL,         0 , 0,        0, (APTR)MEN_EXECUTE_REXX_COMMAND},
  466.     {  NM_ITEM, NM_BARLABEL,     0 , 0,        0, (APTR)0},
  467.     {  NM_ITEM, NULL,         0 , TICK,    0, (APTR)MEN_RECORD},
  468.     {  NM_ITEM, NULL,         0 , TICK,    0, (APTR)MEN_RECORD_LINE},
  469.     {  NM_ITEM, NM_BARLABEL,     0 , 0,        0, (APTR)0},
  470.     {  NM_ITEM, NULL,         0 , 0,        0, (APTR)MEN_EDIT_TRAPS},
  471.     {  NM_ITEM, NULL,         0 , TICK,    0, (APTR)MEN_DISABLE_TRAPS},
  472.  
  473.     { NM_TITLE, NULL,         0 , 0,        0, (APTR)0},
  474.     {  NM_ITEM, NULL,         0 , 0,        0, (APTR)MEN_PHONEBOOK},
  475.     {  NM_ITEM, NULL,         0 , 0,        0, (APTR)MEN_REDIAL},
  476.     {  NM_ITEM, NULL,         0 , 0,        0, (APTR)MEN_DIAL_NUMBER},
  477.     {  NM_ITEM, NM_BARLABEL,     0 , 0,        0, (APTR)0},
  478.     {  NM_ITEM, NULL,         0 , 0,        0, (APTR)MEN_SEND_BREAK},
  479.     {  NM_ITEM, NULL,         0 , 0,        0, (APTR)MEN_HANG_UP},
  480.     {  NM_ITEM, NM_BARLABEL,     0 , 0,        0, (APTR)0},
  481.     {  NM_ITEM, NULL,         0 , 0,        0, (APTR)MEN_WAIT},
  482.     {  NM_ITEM, NM_BARLABEL,     0 , 0,        0, (APTR)0},
  483.     {  NM_ITEM, NULL,         0 , 0,        0, (APTR)MEN_FLUSH_BUFFER},
  484.     {  NM_ITEM, NULL,         0 , 0,        0, (APTR)MEN_RELEASE_DEVICE},
  485.  
  486.     { NM_TITLE, NULL,         0 , 0,        0, (APTR)0},
  487.     {  NM_ITEM, NULL,         0 , 0,        0, (APTR)MEN_UPLOAD_ASCII},
  488.     {  NM_ITEM, NULL,         0 , 0,        0, (APTR)MEN_DOWNLOAD_ASCII},
  489.     {  NM_ITEM, NM_BARLABEL,     0 , 0,        0, (APTR)0},
  490.     {  NM_ITEM, NULL,         0 , 0,        0, (APTR)MEN_UPLOAD_TEXT},
  491.     {  NM_ITEM, NULL,         0 , 0,        0, (APTR)MEN_DOWNLOAD_TEXT},
  492.     {  NM_ITEM, NULL,         0 , 0,        0, (APTR)MEN_EDIT_AND_UPLOAD_TEXT},
  493.     {  NM_ITEM, NM_BARLABEL,     0 , 0,        0, (APTR)0},
  494.     {  NM_ITEM, NULL,         0 , 0,        0, (APTR)MEN_UPLOAD_BINARY},
  495.     {  NM_ITEM, NULL,         0 , 0,        0, (APTR)MEN_DOWNLOAD_BINARY},
  496.  
  497.     { NM_TITLE, NULL,         0 , 0,        0, (APTR)0},
  498.     {  NM_ITEM, NULL,         0 , 0,        0, (APTR)MEN_CLEAR_BUFFER},
  499.     {  NM_ITEM, NULL,         0 , 0,        0, (APTR)MEN_DISPLAY_BUFFER},
  500.     {  NM_ITEM, NULL,         0 , 0,        0, (APTR)MEN_CLOSE_BUFFER},
  501.     {  NM_ITEM, NM_BARLABEL,     0 , 0,        0, (APTR)0},
  502.     {  NM_ITEM, NULL,         0 , TICK,    0, (APTR)MEN_FREEZE_BUFFER},
  503.     {  NM_ITEM, NM_BARLABEL,     0 , 0,        0, (APTR)0},
  504.     {  NM_ITEM, NULL,         0 , 0,        0, (APTR)MEN_OPEN_BUFFER},
  505.     {  NM_ITEM, NULL,         0 , 0,        0, (APTR)MEN_SAVE_BUFFER_AS},
  506.  
  507.     { NM_TITLE, NULL,         0 , 0,        0, (APTR)0},
  508.     {  NM_ITEM, NULL,         0 , 0,        0, (APTR)MEN_CLEAR_SCREEN},
  509.     {  NM_ITEM, NULL,         0 , 0,        0, (APTR)MEN_RESET_FONT},
  510.     {  NM_ITEM, NULL,         0 , 0,        0, (APTR)MEN_RESET_STYLES},
  511.     {  NM_ITEM, NULL,         0 , 0,        0, (APTR)MEN_RESET_TERMINAL},
  512.  
  513.     { NM_TITLE, NULL,         0 , 0,        0, (APTR)0},
  514.     {  NM_ITEM, NULL,         0 , 0,        0, (APTR)MEN_SERIAL},
  515.     {  NM_ITEM, NULL,         0 , 0,        0, (APTR)MEN_MODEM},
  516.     {  NM_ITEM, NULL,         0 , 0,        0, (APTR)MEN_SCREEN},
  517.     {  NM_ITEM, NULL,         0 , 0,        0, (APTR)MEN_TERMINAL},
  518.     {  NM_ITEM, NULL,         0 , 0,        0, (APTR)MEN_SET_EMULATION},
  519.     {  NM_ITEM, NULL,         0 , 0,        0, (APTR)MEN_CLIPBOARD},
  520.     {  NM_ITEM, NULL,         0 , 0,        0, (APTR)MEN_CAPTURE},
  521.     {  NM_ITEM, NULL,         0 , 0,        0, (APTR)MEN_COMMANDS},
  522.     {  NM_ITEM, NULL,         0 , 0,        0, (APTR)MEN_MISC},
  523.     {  NM_ITEM, NULL,         0 , 0,        0, (APTR)MEN_PATH},
  524.     {  NM_ITEM, NULL,         0 , 0,        0, (APTR)MEN_TRANSFER_PROTOCOL},
  525.     {  NM_ITEM, NM_BARLABEL,     0 , 0,        0, (APTR)0},
  526.     {  NM_ITEM, NULL,         0 , 0,        0, (APTR)MEN_TRANSFER},
  527.     {  NM_ITEM, NULL,         0 , 0,        0, (APTR)MEN_TRANSLATION},
  528.     {  NM_ITEM, NULL,         0 , 0,        0, (APTR)MEN_MACROS},
  529.     {  NM_ITEM, NULL,         0 , 0,        0, (APTR)MEN_CURSORKEYS},
  530.     {  NM_ITEM, NULL,         0 , 0,        0, (APTR)MEN_FAST_MACROS},
  531.     {  NM_ITEM, NULL,         0 , 0,        0, (APTR)MEN_HOTKEYS},
  532.     {  NM_ITEM, NULL,         0 , 0,        0, (APTR)MEN_SPEECH},
  533.     {  NM_ITEM, NULL,         0 , 0,        0, (APTR)MEN_SOUND},
  534.     {  NM_ITEM, NULL,         0 , 0,        0, (APTR)MEN_SET_CONSOLE},
  535.     {  NM_ITEM, NM_BARLABEL,     0 , 0,        0, (APTR)0},
  536.     {  NM_ITEM, NULL,         0 , 0,        0, (APTR)MEN_OPEN_SETTINGS},
  537.     {  NM_ITEM, NULL,         0 , 0,        0, (APTR)MEN_SAVE_SETTINGS},
  538.     {  NM_ITEM, NULL,         0 , 0,        0, (APTR)MEN_SAVE_SETTINGS_AS},
  539.  
  540.     { NM_TITLE, NULL,         0 , 0,        0, (APTR)0},
  541.     {  NM_ITEM, NULL,         0 , TICK,    0, (APTR)MEN_STATUS_WINDOW},
  542.     {  NM_ITEM, NULL,         0 , TICK,    0, (APTR)MEN_REVIEW_WINDOW},
  543.     {  NM_ITEM, NULL,         0 , CHECKIT,    0, (APTR)MEN_PACKET_WINDOW},
  544.     {  NM_ITEM, NULL,         0 , TICK,    0, (APTR)MEN_FAST_MACROS_WINDOW},
  545.     {  NM_ITEM, NULL,         0 , 0,        0, (APTR)MEN_UPLOAD_QUEUE_WINDOW},
  546.  
  547.     { NM_TITLE, NULL,         0 , 0,        0, (APTR)0},
  548.     {   NM_END, 0,             0 , 0,        0, (APTR)0}
  549. };
  550.  
  551. struct Menu    *Menu;
  552. struct Image    *AmigaGlyph,
  553.         *CheckGlyph;
  554.  
  555.     /* Pointer. */
  556.  
  557. UWORD __chip Stopwatch[(1 + 16 + 1) * 2] =
  558. {
  559.     0x0000,0x0000,
  560.  
  561.     0x0400,0x07C0,
  562.     0x0000,0x07C0,
  563.     0x0100,0x0380,
  564.     0x0000,0x07E0,
  565.     0x07C0,0x1FF8,
  566.     0x1FF0,0x3FEC,
  567.     0x3FF8,0x7FDE,
  568.     0x3FF8,0x7FBE,
  569.     0x7FFC,0xFF7F,
  570.     0x7EFC,0xFFFF,
  571.     0x7FFC,0xFFFF,
  572.     0x3FF8,0x7FFE,
  573.     0x3FF8,0x7FFE,
  574.     0x1FF0,0x3FFC,
  575.     0x07C0,0x1FF8,
  576.     0x0000,0x07E0,
  577.  
  578.     0x0000,0x0000
  579. };
  580.  
  581.     /* Cross-hatch pattern. */
  582.  
  583. ULONG __chip Crosshatch = 0x5555AAAA;
  584.  
  585.     /* Ghosting pattern, slightly different from the cross-hatch pattern. */
  586.  
  587. ULONG __chip Ghosting = 0x44441111;
  588.  
  589.     /* Configuration. */
  590.  
  591. struct Configuration    *Config,
  592.             *PrivateConfig,
  593.             *BackupConfig;
  594. struct SpeechConfig     SpeechConfig;
  595. BYTE             English = TRUE;
  596. BYTE             Status;
  597. BYTE             Online,WasOnline;
  598. ULONG             OnlineMinutes,OnlinePlus;
  599. UWORD             PublicModes;
  600.  
  601. UBYTE __far         LastConfig[MAX_FILENAME_LENGTH];
  602. UBYTE __far         DefaultPubScreenName[MAXPUBSCREENNAME + 1],
  603.              SomePubScreenName[MAXPUBSCREENNAME + 1];
  604.  
  605.     /* Capture file. */
  606.  
  607. struct Buffer        *FileCapture;
  608. BPTR             PrinterCapture;
  609. UBYTE __far         CaptureName[MAX_FILENAME_LENGTH];
  610. BYTE             StandardPrinterCapture,
  611.              ControllerActive;
  612. LONG             BufferFlushCount;
  613.  
  614.     /* Buffer. */
  615.  
  616. UBYTE            **BufferLines;
  617. LONG             Lines;
  618. struct SignalSemaphore    *BufferSemaphore,
  619.              BufferTaskSemaphore;
  620. LONG             MaxLines = 100;
  621. LONG             BufferSpace;
  622. BYTE             BufferClosed;
  623. BYTE             BufferFrozen;
  624.  
  625. struct MinList         ReviewBufferHistory,
  626.              TextBufferHistory;
  627.  
  628.     /* Sound support.c */
  629.  
  630. struct SoundConfig     SoundConfig;
  631. BYTE             SoundChanged = FALSE;
  632.  
  633.     /* Phonebook. */
  634.  
  635. struct PhoneEntry    **Phonebook;
  636. LONG             PhoneSize;
  637. LONG             NumPhoneEntries;
  638. UBYTE __far         PhonePassword[256];
  639. BYTE             PhonePasswordUsed,
  640.              RebuildMenu;
  641. UBYTE __far         Password[100];
  642. UBYTE __far         UserName[100];
  643. UBYTE __far         GlobalPassword[256];
  644.  
  645. UBYTE __far         CurrentBBSName[40],
  646.              CurrentBBSNumber[100],
  647.              CurrentBBSComment[100];
  648.  
  649. UBYTE __far         LastPhone[MAX_FILENAME_LENGTH];
  650. UBYTE __far         LastKeys[MAX_FILENAME_LENGTH];
  651. UBYTE __far         LastMacros[MAX_FILENAME_LENGTH];
  652. UBYTE __far         LastCursorKeys[MAX_FILENAME_LENGTH];
  653. UBYTE __far         LastTranslation[MAX_FILENAME_LENGTH];
  654. UBYTE __far         LastSpeech[MAX_FILENAME_LENGTH];
  655. UBYTE __far         LastSound[MAX_FILENAME_LENGTH];
  656.  
  657. struct MacroKeys    *MacroKeys;
  658. struct CursorKeys    *CursorKeys;
  659.  
  660.     /* Console stuff. */
  661.  
  662. UBYTE            *StripBuffer;
  663. UWORD             LastLine,LastColumn,LastPixel;
  664. BYTE             Charset,Attributes,FgPen,BgPen;
  665. WORD             CursorX,CursorY,Top,Bottom;
  666. BYTE             UseRegion,RegionSet,InSequence,Quiet,Blocking;
  667. BYTE            *TabStops;
  668. UWORD             TabStopMax;
  669. BYTE             CharMode[2];
  670.  
  671. BYTE             ResetDisplay,
  672.              DisplayReopened,
  673.              FixPubScreenMode,
  674.              FixScreenSize,
  675.              Apocalypse;
  676.  
  677. struct SignalSemaphore     TerminalSemaphore;    // Protection from shape changers
  678.  
  679.     /* Flow filter. */
  680.  
  681. STRPTR             AttentionBuffers[SCAN_COUNT];
  682. BYTE             BaudPending,FullCheck,UseFlow;
  683. UBYTE             BaudBuffer[80],BaudCount;
  684.  
  685. struct FlowInfo         FlowInfo;
  686.  
  687. STRPTR             DataHold;
  688. LONG             DataSize;
  689.  
  690.     /* Transfer data. */
  691.  
  692. BYTE             BinaryTransfer;
  693. LONG             TransferBits;
  694.  
  695. VOID            (*  ConTransfer)(STRPTR,LONG);
  696.  
  697. UBYTE            *DownloadPath;
  698. BYTE             Uploading;
  699. BYTE             DidTransfer;
  700.  
  701. struct Window        *TransferWindow,
  702.             *TransferPerfWindow;
  703. UBYTE __far         TransferTitleBuffer[256];
  704. BOOLEAN             TransferZoomed = FALSE;
  705. STRPTR             TransferWindowTitle;
  706.  
  707. struct LayoutHandle    *TransferHandle;
  708. struct Menu        *TransferMenu;
  709. struct Gadget        *TransferGadgetArray[GAD_TRANSFER_SKIP + 1];
  710. struct List         TransferInfoList;
  711.  
  712. struct FileTransferInfo    *FileTransferInfo;
  713.  
  714. struct XPR_IO        *XprIO;
  715. UBYTE __far         ProtocolOptsBuffer[256];
  716. BYTE             NewLibrary,NewOptions;
  717. BOOLEAN             XPRCommandSelected;
  718. UBYTE __far         LastXprLibrary[MAX_FILENAME_LENGTH];
  719. UBYTE __far         ConvNumber[30],ConvNumber10[30];
  720. BYTE             UsesZModem,SendAbort,TransferAborted,TransferFailed,TransferError;
  721.  
  722.     /* The standard ZModem cancel sequence
  723.      * (ten CAN chars followed by ten
  724.      * BS chars).
  725.      */
  726.  
  727. UBYTE ZModemCancel[] =
  728. {
  729.     24,24,24,24,24,24,24,24,24,24,8,8,8,8,8,8,8,8,8,8
  730. };
  731.  
  732.     /* Pay per minute. */
  733.  
  734. LONG             CurrentPay;
  735. LONG             PayPerUnit[2];
  736. LONG             SecPerUnit[2];
  737. LONG             WhichUnit;
  738. struct PhoneEntry    *ChosenEntry;
  739. BYTE             ChosenInUse;
  740.  
  741.     /* Execute a command/script. */
  742.  
  743. UBYTE __far         WindowName[256];
  744.  
  745. ULONG             BlockNestCount;
  746. BYTE             WeAreBlocking;
  747.  
  748.     /* Dial list. */
  749.  
  750. struct List        *DialList;
  751. BYTE             SendStartup;
  752. LONG             FirstDialMenu;
  753. struct RexxMsg        *DialMsg;
  754.  
  755.     /* TermMain data. */
  756.  
  757. BYTE             ReleaseSerial;
  758. BYTE             ResetSerial;
  759. BYTE             MainTerminated,
  760.              IconTerminated = TRUE,
  761.              DoIconify = FALSE,
  762.              DoDial = DIAL_IGNORE,
  763.              KeepQuiet;
  764.  
  765. BYTE             ConfigChanged,PhonebookChanged,TranslationChanged,
  766.              MacroChanged,CursorKeysChanged,FastMacrosChanged,
  767.              HotkeysChanged,SpeechChanged,BufferChanged;
  768.  
  769.     /* Upload/Download paths. */
  770.  
  771. UBYTE __far         LastDownload[MAX_FILENAME_LENGTH];
  772. UBYTE __far         LastUpload[MAX_FILENAME_LENGTH];
  773.  
  774.     /* String gadget hooks. */
  775.  
  776. struct Window        *CommandWindow;
  777. struct Gadget        *CommandGadget;
  778.  
  779. BYTE             ClipInput,
  780.              ClipXerox,
  781.              ClipPrefix;
  782.  
  783.     /* Text sending. */
  784.  
  785. UBYTE __far         SendPrompt[256];
  786. LONG             SendPromptLen;
  787. BYTE            (*  SendLine)(register STRPTR,register LONG);
  788.  
  789.     /* Packet window. */
  790.  
  791. struct Window        *PacketWindow;
  792. struct Gadget        *PacketGadgetArray[2];
  793. struct Menu        *PacketMenu;
  794. struct Gadget        *PacketGadgetList;
  795. struct List         PacketHistoryList;
  796.  
  797.     /* Some more colour control flags. */
  798.  
  799. BYTE             Initializing,LoadColours;
  800.  
  801.     /* The character raster. */
  802.  
  803. UBYTE            *Raster,*RasterAttr;
  804. LONG             RasterWidth,RasterHeight;
  805. BYTE             Marking;
  806. struct SignalSemaphore    *RasterSemaphore;
  807. BYTE             RasterEnabled = TRUE;
  808.  
  809.     /* Generic lists. */
  810.  
  811. struct GenericList    *GenericListTable[GLIST_COUNT];
  812.  
  813.     /* File version test. */
  814.  
  815. ULONG VersionProps[2] =
  816. {
  817.     ID_TERM,
  818.     ID_VERS
  819. };
  820.  
  821.     /* Window stack. */
  822.  
  823. struct Window        *TopWindow;
  824.  
  825. struct Window        *WindowStack[5];
  826. WORD             WindowStackPtr;
  827.  
  828.     /* Global term ID. */
  829.  
  830. LONG             TermID;
  831. UBYTE __far         TermIDString[MAXPUBSCREENNAME + 1];
  832. UBYTE __far         RexxPortName[256];
  833.  
  834.     /* Fast! macros. */
  835.  
  836. struct List         FastMacroList;
  837. LONG             FastMacroCount;
  838. UBYTE __far         LastFastMacros[MAX_FILENAME_LENGTH];
  839. struct Window        *FastWindow;
  840. WORD             FastWindowLeft        = -1,
  841.              FastWindowTop        = -1,
  842.              FastWindowHeight    = -1;
  843.  
  844.     /* Double-buffered file locking. */
  845.  
  846. struct List         DoubleBufferList;
  847. struct SignalSemaphore     DoubleBufferSemaphore;
  848.  
  849.     /* XEM interface. */
  850.  
  851. struct XEM_IO        *XEM_IO;
  852. ULONG             XEM_Signal;
  853. struct XEmulatorHostData XEM_HostData;
  854. UBYTE            *OptionTitle;
  855. struct List         XEM_MacroList;
  856. struct XEmulatorMacroKey *XEM_MacroKeys;
  857. UBYTE __far         EmulationName[40];
  858.  
  859. struct List         EmptyList;
  860.  
  861.     /* Screen scrolling support. */
  862.  
  863. UWORD             ScrollLineFirst,ScrollLineLast,
  864.              ScrollLineCount;
  865. struct ScrollLineInfo    *ScrollLines;
  866.  
  867.     /* term review buffer. */
  868.  
  869. struct Window        *ReviewWindow;
  870.  
  871.     /* Background information. */
  872.  
  873. ULONG             BytesIn,
  874.              BytesOut;
  875. struct DateStamp     SessionStart;
  876. struct Window        *InfoWindow;
  877.  
  878.     /* Gadget support routines */
  879.  
  880. LONG             InterWidth,
  881.              InterHeight;
  882.  
  883.     /* Character translation. */
  884.  
  885. struct TranslationEntry    **SendTable,
  886.             **ReceiveTable;
  887.  
  888.     /* Window alignment information. */
  889.  
  890. struct WindowInfo WindowInfoTable[] =
  891. {
  892.     WINDOW_PACKET,    WC_ALIGNBELOW|WC_EXPANDWIDTH,    0,0,0,0,
  893.     WINDOW_STATUS,    WC_ALIGNRIGHT,            0,0,0,0,
  894.     WINDOW_FILE,    NULL,                0,0,0,0,
  895.     WINDOW_REVIEW,    WC_ALIGNTOP|WC_EXPANDWIDTH,    0,0,0,0,
  896.     WINDOW_FAST,    WC_ALIGNTOP|WC_ALIGNSIDE,    0,0,0,0,
  897.     WINDOW_FONT,    NULL,                0,0,0,0,
  898.     WINDOW_SCREEN,    NULL,                0,0,0,0,
  899.     WINDOW_PERF,    NULL,                0,0,0,0,
  900. };
  901.  
  902.     /* New user interface. */
  903.  
  904. extern ULONG HookEntry();
  905.  
  906. struct Hook LocaleHook =
  907. {
  908.     {NULL},
  909.     (HOOKFUNC)HookEntry,
  910.     (HOOKFUNC)LocaleHookFunc
  911. };
  912.  
  913.     /* AmigaGuide hook. */
  914.  
  915. struct Hook GuideHook =
  916. {
  917.     {NULL},
  918.     (HOOKFUNC)GuideSetupHook
  919. };
  920.  
  921.     /* Special queue management. */
  922.  
  923. struct MsgQueue    *SpecialQueue;
  924.  
  925.     /* Phonebook edit list support. */
  926.  
  927. STRPTR        *EditLabels;
  928. struct List    *EditList;
  929. struct Node    *EditNode;
  930.  
  931.     /* Window and Screen backfill hook. */
  932.  
  933. struct Hook BackfillHook =
  934. {
  935.     {NULL},
  936.     (HOOKFUNC)BackfillRoutine
  937. };
  938.  
  939.     /* Intercept data going through SerWrite. */
  940.  
  941. BOOLEAN (*SerWriteBypass)(STRPTR Buffer,LONG Size);
  942.  
  943.     /* The incredibly shrinking file name. */
  944.  
  945. UBYTE __far    ShrunkenName[MAX_FILENAME_LENGTH],
  946.         OriginalName[MAX_FILENAME_LENGTH];
  947.  
  948.     /* Terminal emulation task. */
  949.  
  950. struct MsgQueue        *TerminalQueue;
  951.  
  952.     /* DNet/ParaBIT support. */
  953. /*
  954. struct DChannel        *NetChannel;
  955. struct MsgPort        *NetListen;
  956. ULONG             NetSigMask;
  957. BOOLEAN             NetTerminated;
  958. */
  959.  
  960.     /* AppIcon data. */
  961.  
  962. STATIC UWORD DropData[304] =
  963. {
  964.     0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
  965.     0x0000,0x0000,0x2000,0x1000,0x0000,0x0000,0xF000,0x1000,
  966.     0x0000,0x0001,0x9800,0x1000,0x0000,0x0003,0x1C3E,0x1000,
  967.     0x0000,0x0003,0xFC30,0x1000,0x0000,0x0000,0x01FF,0x1000,
  968.     0x0000,0x0000,0x01FC,0x1000,0x0000,0x0060,0x0000,0x1000,
  969.     0x0000,0x001F,0xFFFF,0xF000,0x0000,0x0000,0x0000,0x0000,
  970.     0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0700,0x0000,
  971.     0x07FF,0xFFFE,0x0700,0x0000,0x07FF,0xFFEE,0x0700,0x0000,
  972.     0x0755,0x555E,0x0700,0x0000,0x07AA,0xAAAE,0x1FC0,0x0000,
  973.     0x0755,0x555E,0x0F80,0x0000,0x07AA,0xAAAE,0x0700,0x0000,
  974.     0x0755,0x555E,0x0200,0x0000,0x07AA,0xAAAE,0x0000,0x0000,
  975.     0x0755,0x555E,0x0000,0x0000,0x07FF,0xFFFE,0x0000,0x0000,
  976.     0x07FF,0xFFFE,0x0000,0x0000,0x07FF,0xFFFC,0x0000,0x0000,
  977.     0x0000,0x0000,0x0000,0x0000,0x7FFF,0xFFFF,0xE000,0x0000,
  978.     0x7FFF,0xFEFF,0xE000,0x0000,0x7FFF,0xFEF0,0x0000,0x0000,
  979.     0x7FE5,0x54E7,0xFF80,0x0000,0x7FFF,0xFF8E,0x0FC0,0x0000,
  980.     0x7FFF,0xFFBD,0xFCF0,0x0000,0x0FFF,0xFFFF,0xFEE0,0x0000,
  981.     0x0FFF,0xFFFB,0xD700,0x0000,0x0000,0x0007,0xAF80,0x0000,
  982.     0x0000,0x000F,0xFF80,0x0000,0x0000,0x0007,0xFF00,0x0000,
  983.  
  984.     0x0000,0x007F,0xFFFE,0x0000,0x0000,0x007F,0xFFFF,0x8000,
  985.     0x0000,0x0060,0x20FF,0xE000,0x0000,0x0060,0xF0FF,0xE000,
  986.     0x0000,0x0061,0x98FF,0xE000,0x0000,0x0063,0x1CBF,0xE000,
  987.     0x0000,0x0063,0xFCB7,0xE000,0x0000,0x007F,0xFDFF,0xE000,
  988.     0x0000,0x007F,0xFDFF,0xE000,0x0000,0x007F,0xFFFF,0xE000,
  989.     0x0000,0x001F,0xFFFF,0xE000,0x0000,0x0000,0x0000,0x0000,
  990.     0x0000,0x0000,0x0000,0x0000,0x07FF,0xFFFC,0x0000,0x0000,
  991.     0x0FFF,0xFFFC,0x0000,0x0000,0x0EAA,0xAABC,0x0000,0x0000,
  992.     0x0F55,0x555C,0x0000,0x0000,0x0EAA,0xAABC,0x0000,0x0000,
  993.     0x0F55,0x555C,0x0000,0x0000,0x0EAA,0xAABC,0x0000,0x0000,
  994.     0x0F55,0x555C,0x0000,0x0000,0x0EAA,0xAABC,0x0000,0x0000,
  995.     0x0FFF,0xFFFC,0x0000,0x0000,0x0FFF,0xFFFC,0x0000,0x0000,
  996.     0x0FFF,0xFFFC,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
  997.     0x7FFF,0xFFFF,0xC000,0x0000,0xFFFF,0xFFFF,0xC000,0x0000,
  998.     0xFFEA,0xABFF,0xC000,0x0000,0xFFE0,0x03FF,0xFF00,0x0000,
  999.     0xFFFF,0xFFFF,0xFFC0,0x0000,0xFFFF,0xFFFF,0xF9E0,0x0000,
  1000.     0x0000,0x007F,0xFDE0,0x0000,0x1FFF,0xFFC7,0xAF00,0x0000,
  1001.     0x0000,0x0007,0x5F00,0x0000,0x0000,0x000F,0xFF80,0x0000,
  1002.     0x0000,0x001F,0xFF00,0x0000,0x0000,0x0000,0x0000,0x0000
  1003. };
  1004.  
  1005. STATIC struct Image DropImage =
  1006. {
  1007.     0,0,
  1008.     52,38,2,
  1009.     DropData,
  1010.     0x03,0x00,
  1011.     NULL
  1012. };
  1013.  
  1014. struct DiskObject DropIcon =
  1015. {
  1016.     WB_DISKMAGIC,
  1017.     WB_DISKVERSION,
  1018.  
  1019.     NULL,
  1020.     175,18,
  1021.     52,39,
  1022.     0x0005,
  1023.     0x0003,
  1024.     0x0001,
  1025.     &DropImage,
  1026.     NULL,
  1027.     NULL,
  1028.     NULL,
  1029.     NULL,
  1030.     NULL,
  1031.     NULL,
  1032.  
  1033.     WBTOOL,
  1034.     NULL,
  1035.     NULL,
  1036.     NO_ICON_POSITION,
  1037.     NO_ICON_POSITION,
  1038.     NULL,
  1039.     NULL,
  1040.     8192
  1041. };
  1042.  
  1043.     /* Remember some of the incoming data. */
  1044.  
  1045. BOOL    RememberOutput,
  1046.     RememberInput,
  1047.  
  1048.     Recording,
  1049.     RecordingLine;
  1050.  
  1051.     /* Trap settings. */
  1052.  
  1053. BOOLEAN        WatchTraps;
  1054. BOOLEAN        TrapsChanged;
  1055. UBYTE        LastTraps[MAX_FILENAME_LENGTH];
  1056.